<!doctype html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
		<meta name="renderer" content="webkit">
		<title>采购合同打印 / NT ERP</title>

		<meta name="keywords" content="ERP" />
		<meta name="description" content="" />
		<link rel="shortcut icon" href="/favicon.ico" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<link href="/static/Admin/css/bootstrap_print.css" rel="stylesheet">
		<link href="/static/Admin/css/fontawesome.min.css" rel="stylesheet">
		<link href="/static/Admin/css/default.css" rel="stylesheet">
		<link href="/static/Admin/css/ntStyle.css" rel="stylesheet">

		<script language="javascript" src="/static/Admin/webjs/jquery.min.js"></script>
		<script language="javascript" src="/static/Admin/webjs/jquery-ui.min.js"></script>
		<script>
			/*
				Handle jQuery plugin naming conflict between jQuery UI and Bootstrap 
				解决 jQuery UI和Bootstrap 都使用tooltip 的冲突
			*/
			$.widget.bridge('uibutton', $.ui.button);
			$.widget.bridge('uitooltip', $.ui.tooltip);
		</script>
		<script language="javascript" src="/static/Admin/webjs/bootstrap.min.js"></script>
		<script language="javascript" src="/static/Admin/js/display.js"></script>
		
		<link href="/static/Admin/css/ntPrint.css" rel="stylesheet">
		<script language="javascript" src="/static/Admin/webjs/print.js"></script>
    	<script src="/static/Admin/webjs/formatunit.js"></script>
    	<script src="/static/Admin/webjs/arabia_to_Chinese.js"></script>
    	<script src="/static/Admin/webjs/vue.js"></script>
	</head>

	<body>
		<div id="main">
		<input type="hidden" id="po_id" value="{$po_id|default=0}">
		<div class="container" id="printPage">
			
			<!--页眉-->
			<div id="pHead">
				<div class="row" style="margin-bottom: 0.5rem">
					<div class="col-6">
						<span style="float: left"><img src="/po_title.png" height="38px" alt="NT LOGO"></span>
					</div>
					<div class="col-6 text-right" style="padding-top:1rem">
						合同编号: {$po_id} / 打印时间: {$time}
					</div>
				</div>
			</div>
			
			<!--页脚-->
			<div id="pFoot">
				<div class="row" style="padding-top:0.2rem;border-top: 2px #CCC solid">
					<div class="col-6 s-1">
						NEXT TRANDING . {$admin_name} / {$time}
					</div>
					<div class="col-6 text-right s-2">
						<span class="page s-1">1</span> / <span class="pages s-1">3</span>
					</div>
				</div>
			</div>
			
			<!-- 页头-->
			<div id="pTitle">
				<div class="row" style="margin-bottom: 0.6rem">
					<div class="col-12">
						<table class="table-sm" style="margin-bottom:0;border-top:2px #ccc solid;border-bottom:1px #ccc solid;table-layout:fixed;">
							<tbody>
								<tr>
									<!-- 卖方 -->
									<td width="10%">卖方</td>
									<td width="40%">
										{$buyPo.sellcompany_name}
									</td>
									<!-- 买方 -->
									<td width="10%">买方</td>
									<td width="40%">
										深圳益邦贸易有限公司
									</td>
								</tr>
								<tr>
									<!-- 卖方 -->
									<td>地址</td>
									<td>
										{$buyPo.sellcompany_addr} 
									</td>
									<!-- 买方 -->
									<td>地址</td>
									<td>
										深圳龙岗平湖平安大道国际电商中心11栋1702室
									</td>
								</tr>
								
								<tr>
									<!-- 卖方 -->
									<td>联系人</td>
									<td>
										{$sellcompany_linkman.name}
									</td>
									<!-- 买方 -->
									<td>联系人</td>
									<td>
										{$amdinInfo.nickname}
									</td>
								</tr>
								<tr>
									<!-- 卖方 -->
									<td>手机/电话</td>
									<td style="word-wrap:break-word;word-break:break-all">{$sellcompany_linkman.linkmethod}</td>
									<!-- 买方 -->
									<td>手机/电话</td>
									<td style="word-wrap:break-word;word-break:break-all">{$amdinInfo.linkmethod}</td>
								</tr>
								</template>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			
			
			<div id="pBody">
				<!-- 产品列表 -->
				<div class="row">
					<div class="col-12">
						<table class="table table-noborder printTable">
							<thead class="thead-light s-2">
								<tr>
									<th width="4%">#</th>
									<th>产品</th>
									<th width="10%">箱规</th>
									<th width="10%">箱数</th>
									<th width="10%">数量</th>
									<th width="10%">单价</th>
									<th width="14%">合计</th>
								</tr>
							</thead>
							<tbody>
								{foreach $buyPoPro as $k1=>$v1}
								<tr style="border-top: 1px #ccc solid">
									<td align="center" rowspan="2">{{ formatUnit( {$k1+1},'id' ) }}</td>
									<td>
										<div class="pro" style="min-height:50px">
											<div class="pro-icon">
												<img src="{$v1.proInfo.img_url}" width="48px" height="48px" alt="ICON">
											</div>
											<div class="name s-1">
												<small class="blue">{$v1.proInfo.prochar_id}{$v1.proInfo.brand_name}{$v1.proInfo.model}{$v1.feature}</small><br>
												{$v1.proInfo.pro_name}
												
											</div>
										</div>
									</td>
									<td align="right">
										{{formatUnit({$v1.proInfo.prochar_qty},'PCS')}}<br><small class="unit">PCS/CTN</small>
									</td>
									<td align="right">
										{{formatUnit({$v1.qty},'CTN')}}<br><small class="unit">CTN</small>
									</td>
									<td align="right">
										{{formatUnit({$v1.qty*$v1.proInfo.prochar_qty},'PCS')}}<br><small class="unit">PCS</small>
									</td>
									<td align="right">
										{{formatUnit({$v1.price},'$')}}<br><small class="unit">CNY</small>
									</td>
									<td align="right">
										{{formatUnit({$v1.price*$v1.qty*$v1.proInfo.prochar_qty},'$')}}
										<br><small class="unit">CNY</small>
									</td>
								</tr>
									
								<tr>
									{foreach $v1['prodesc_cat'] as $k1_=>$v1_}
									<td colspan="6">
										<div>
											<span class="text-primary b">{$v1_.prodesc_cat_name}：</span>
											{$v1_.content}
										</div>
									</td>
									{/foreach}
								</tr>
								{/foreach}
								<tr style="border-top: 1px #ccc solid">
									<td colspan="7" align="right" style="background-color: #eef0f0">
										货款金额合计: <span class="a-1 b">{$buyPoProPriceSum}</span> 元（金额大写：{{ Arabia_to_Chinese({$buyPoProPriceSum_}) }}）
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				
				<!-- 其他费用 -->
				{notempty name="buyPoCost"}
				<div class="row">
					<div class="col-12">
						<table class="table printTable">
							<thead>
								<tr>
									<th colspan="3" class="bg-light s-1">其他费用</th>
								</tr>
							</thead>
							<tbody>
								{foreach $buyPoCost as $k2=>$v2}
								<tr class="s-1">
									<td align="center">{{ formatUnit( {$k2+1},'id' ) }}</td>
									<td>{$v2.remarks}</td>
									<td align="right">
										{{formatUnit( {$v2.amount},'$')}} <small class="unit">CNY</small>
									</td>
								</tr>
								{/foreach}
								<tr style="border-top: 1px #ccc solid">
									<td colspan="7" align="right" style="background-color: #eef0f0">
										其他费用合计: <span class="a-1 b">{$buyPoCostAmountSum}</span> 元（金额大写：{{ Arabia_to_Chinese( {$buyPoCostAmountSum_} ) }}）
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				{/notempty}
				<!-- 合同条款 -->
				<div class="row" style="padding: 1rem 0">
					<div class="col-12">
						<table class="table table-noborder printTable">
							<tbody>
								{foreach $terms as $k3=>$v3}
								<tr class="s-1">
									<td>
										<div class="blue b">{$v3.terms_type_name}：</div>
										<div class="textarea" style="padding-left: 2rem;white-space:pre-line;">{$v3.content}</div>
									</td>
								</tr>
								{/foreach}
							</tbody>
						</table>
					</div>
				</div>
				
				
				<!-- 签章 -->
				<div class="row" style="padding: 1rem 0">
					<div class="col-12">
						<table class="table table-noborder printTable">
							<tbody>
								<tr>
									<td width="45%">
										<div>卖方：{$buyPo.sellcompany_name}</div>
										<div style="padding-top: 4rem;border-bottom: 1px #333 solid;margin-bottom: 0.5rem"></div>
										<div>代表签名并盖章 </div>
									</td>
									<td width="10%"></td>
									<td width="45%">
										<div>买方：深圳益邦贸易有限公司</div>
										<div style="padding-top: 4rem;border-bottom: 1px #333 solid;margin-bottom: 0.5rem"></div>
										<div>代表签名并盖章 </div>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>			
			</div>
		</div>
		</div>
		<script>
			new Vue({
			    el:'#main',
			    methods:{
			        formatUnit:formatUnit,
			        Arabia_to_Chinese:Arabia_to_Chinese,
			    },
			})
		</script>
	</body>
	
</html>